home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / tch_tpas.zip / PROG17.PAS < prev    next >
Pascal/Delphi Source File  |  1986-04-05  |  768b  |  35 lines

  1. PROGRAM PROG17;
  2. {$U+    Copyright (C), 1985 by Lyle Faurot.  All rights reserved.
  3.  
  4.     New Topics:  Include files
  5.                  Timing function
  6.  
  7. }
  8.  
  9. VAR
  10.   A, B,
  11.   Start_Time,
  12.   Stop_Time,
  13.   Elapsed_Time : Real;
  14.  
  15.   I, J, K      : Integer;
  16.  
  17. {$I Time.Inc    Get system time in seconds }
  18.  
  19. BEGIN
  20.   REPEAT
  21.     WriteLn('Enter number of repetitions: ');
  22.     Read(K);
  23.  
  24.     Start_Time := Time;
  25.     FOR I := 1 to K DO
  26.       A := Time;
  27.     Stop_Time := Time;
  28.  
  29.     Elapsed_Time := Stop_Time - Start_Time;
  30.     Write(' Repetitions took ', Elapsed_Time:-6:4, ' Seconds,');
  31.     WriteLn(' One Repetition took ', Elapsed_Time / K:-6:4,' Seconds');
  32.     WriteLn;
  33.   UNTIL K=9;
  34. END.
  35.